import { get, post,del,patch ,upload,put} from '../../utils/request';

//获取会员信息
export function mebeDetailApi() {
    return get('/member/detail');
}

//修改会员信息
export function editMemberApi(obj) {
    return put('/member',obj);
}

//退出登录
export function loginOutApi() {
    return post('/login/out');
}

//获取收货地址列表
export function addressListApi() {
    return get('/address');
}

//删除收货地址
export function delAddressApi(obj) {
    return del('/address/'+obj,obj);
}

//修改默认地址
export function makeAddressApi(obj) {
    return put('/address/'+obj,obj);
}

//保存收货地址
export function editAddressApi(obj) {
    return post('/address',obj);
}

// 根据地址ID获取地址
export function addressDetailApi(obj) {
    return get('/address/'+obj,obj);
}

//FormData上传单张图片
export function upLoadApi(obj) {
    return upload('/upload',obj);
}


//获取 我的发票信息
export function getInVoiceApi(obj) {
    return get('/invoice/basic', obj);
}

//删除 我的发票
export function delInVoiceApi(obj) {
    return del(`/invoice/${obj.id}`, obj);
}
//充值接口。。。。
export function recharge(obj) {
    return get(`/wxpay/recharge`, obj);
}
//意见反馈
export function feedBackApi(obj) {
    return post(`feedback`, obj);
}
//手机验证
export function phoneCheckApi(obj) {
    return get(`/member/send/code`, obj);
}
//设置默认发票
export function edtInvoiceApi(obj) {
    //put /rest/api/v6.0/invoice
    return put(`/invoice/${obj.id}`);
}

// 验证码验证
export function checkCode(obj) {
    //put /rest/api/v6.0/invoice
    return get(`/member/check/code`, obj);
}


// 绑定手机验证码
export function getBindCodeApi(obj) {
    //put /rest/api/v6.0/invoice
    return get(`/member/bind/new/phone`, obj);
}

// 更改绑定手机
export function putBindApi(obj) {
    //put /rest/api/v6.0/invoice
    return put(`/member/bind/new/phone`, obj);
}
